
package com.jf.cloud.api.auth.feign;

import com.jf.cloud.api.auth.bo.UserInfoInTokenBO;
import com.jf.cloud.common.constant.Auth;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zz
 * @date 2020/7/15
 */
@FeignClient(value = "jfcloud-auth",contextId ="token")
public interface TokenFeignClient {

    /**
     * 校验token并返回token保存的用户信息
     * @param accessToken accessToken
     * @return token保存的用户信息
     */
    @GetMapping(value = Auth.CHECK_TOKEN_URI)
    ServerResponseEntity<UserInfoInTokenBO> checkToken(@RequestParam("accessToken") String accessToken);

    /**
     * 清除用户所有token信息
     * @return
     */
    @GetMapping(value = Auth.CLEAR_TOKEN_URI)
    ServerResponseEntity<Void> clearToken();

    @GetMapping(value = Auth.DEL_TOKEN_URI)
    ServerResponseEntity<Void> deleteToken(@RequestParam("userId") Long userId, @RequestParam("sysType") Integer sysType);


}
